package com.wxg.rpc;

import com.wxg.common.core.dao.mysql.global.Dict;
import com.wxg.common.core.dto.PersonDTO;
import com.wxg.service.DictService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author void
 * @date 2019/6/11 11:10
 * @desc
 */
@RestController
@Slf4j
public class DictRpc {

    @Autowired
    private DictService dictService;

    @GetMapping("/rpc/dict/query")
    public Dict query(String name){
        log.info("------------------请求进来了---------------------");
        return dictService.query(name);
    }

    @GetMapping("/rpc/booleanTest1")
    public Boolean booleanTest1(){
        return null;
    }

    @GetMapping("/rpc/booleanTest2")
    public boolean booleanTest2(){
        return false;
    }
    
    @GetMapping("/rpc/test/construction")
    public PersonDTO testConstruction(){
        PersonDTO personDTO = new PersonDTO("void", 1);
        personDTO.setAge(12);
        return personDTO;
    }
}
